// 判断路径是不是带协议的外链
export const isExternal = (path:string): boolean =>{
	return /^(https?|mailto|tel:)/.test(path);
}

/* 手机号校验 由以1开头的11位数字组成  */
export const validateMobile = (str:string): boolean => {
	if(!str) return false;
	const reg = /^1[3-9]\d{9}$/
	return reg.test(str)
}
/** 密码校验 （必须由数字、字母、特殊字符组合） */
export const validatePassword = (str:string): boolean => {
	if(!str) return false;
	const reg = /(?=.*[0-9])(?=.*[a-z])(?=.*[^a-z0-9])/
	return reg.test(str)
}

export const validateSmsCode = (str:string): boolean =>{
	if(!str) return false;
	const reg = /\d{6}/
	return reg.test(str)
}